﻿
@{
    Layout = "~/Views/Shared/_LayoutSysSetPage.cshtml";
}

<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">

            <fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
                <legend>Redis缓存管理</legend>
                <form class="layui-form layui-form-pane" action="">
                    <div class="layui-form-item">
                        <label class="layui-form-label">key</label>
                        <div class="layui-input-inline">
                            <input id="key" type="text" name="" lay-verify="" placeholder="" autocomplete="off" class="layui-input">
                        </div>

                        <div class="layui-input-inline">
                            <button type="button" class="layui-btn layui-btn-normal" id="activity_info_get">获取</button>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-input-inline">
                            <button type="button" class="layui-btn layui-btn-normal" id="loadgoods">加载商品数据</button>
                        </div>
                    </div>
                    <div class="layui-form-item layui-form-text">
                        <label class="layui-form-label">通用结果展示</label>
                        <div class="layui-input-block">
                            <textarea placeholder="结果展示" class="layui-textarea" id="result"></textarea>
                        </div>
                    </div>
                </form>
            </fieldset>
        </div>
    </div>
</div>
<script>
    layui.use(['jquery','layer', 'form'], function () {
        var layer = layui.layer
            , form = layui.form
            , $ = layui.$;

        //form.on('select(activityid)', function (data) {
        //    console.log(data.elem); //得到select原始DOM对象
        //    console.log(data.value); //得到被选中的值
        //    console.log(data.othis); //得到美化后的DOM对象
        //    $("#activity_material_id").val(data.value);
        //});

        $("#activity_info_get").click(function () {
            $.ajax({
                url: "/SysSet/CacheSet/AjaxGetKey",
                data: { key: $("#key").val()},
                type: "Post",
                dataType: "json",
                success: function (rs) {
                    console.log(rs);
                    $("#result").val(JSON.stringify(rs));
                },
                error: function (rs) {
                    console.log(rs);
                    $("#result").val(JSON.stringify(rs));
                }
            });
        });
        $("#loadgoods").click(function () {
            $.ajax({
                url: "/SysSet/CacheSet/AjaxLoadGoods",
                data: {  },
                type: "Post",
                dataType: "json",
                success: function (rs) {
                    console.log(rs);
                    $("#result").val(JSON.stringify(rs));
                },
                error: function (rs) {
                    console.log(rs);
                    $("#result").val(JSON.stringify(rs));
                }
            });
        });
    });
</script>
